<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\SearchHouseModel */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<div class="house-model-index">


    <?php echo $this->render('_search', ['model' => $searchModel]); ?>

    <p>
        <?php if (\backend\components\MenuHelper::checkRoute('create')) {
            echo Html::a('添加广告位', ['create'], ['class' => 'btn btn-success']);
        } ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            'id',
            [
                'attribute'=>'name',
                'value'=>'adverttype.typename',/*这里的articlecategory是article模型里面关联的方法名，除了首字母，其他都要完全一样，否则会报错*/
                'label'=>'类型名称'
            ],
            [
                'attribute'=>'name',
                'value'=>'house.house_name',/*这里的articlecategory是article模型里面关联的方法名，除了首字母，其他都要完全一样，否则会报错*/
                'label'=>'楼盘名称'
            ],
			
            [
                'class' => 'yii\grid\ActionColumn',
                'template' => '' . \backend\components\MenuHelper::filterActionColumn('{update}&nbsp;&nbsp;{delete}'),
            ],
        ],
    ]); ?>
</div>
